<!doctype html>
<html>
<head>
    <meta charset="utf-8">
</head>
<body>
<script src="./fs.js"></script>
<script>
    fs.writeFile('_test.txt', '123中a文bc', 'utf-8', function (e, d) {
        console.log(e);
        console.log(d);
    })
    setTimeout(function () {
        fs.writeFile('_test_bin.txt', 'abc=', 'base64', function (e, d) {
            console.log(e);
            console.log(d);
        })
    }, 1000);
    setTimeout(function () {
        fs.readFile('_test.txt', 'utf-8', function (e, d) {
            console.log(e);
            console.log(d);
        })
    }, 2000);
    setTimeout(function () {
        fs.readFile('_test_bin.txt', 'base64', function (e, d) {
            console.log(e);
            console.log(d);
        })
    }, 3000);
    setTimeout(function () {
        fs.readdir('.', function (e, d) {
            console.log(e);
            console.log(d);
        })
    }, 4000);


</script>
</body>
</html>